library(xlsx)
install.packages("HonestDiD")
getwd()
getwd()
setwd("~/Dropbox/Deal of Century/Paper/doc_replication/code")
getwd()
sessionInfo()
q()
n
.ls.objects()
q()
n
library(readr)
library(dplyr)
library(ggplot2)
library(lubridate)
setwd("~/Dropbox/doc_replication/")
data<-read_csv("data/social_media_data.csv")
triangle_prop<-subset(data, locality=="Triangle")
non_triangle_prop<-subset(data, locality=="Non-Triangle")
dif_prop<-merge(triangle_prop, non_triangle_prop, by="week")
dif_prop$dif<-dif_prop$prop.x-dif_prop$prop.y
ggplot(dif_prop, aes(x = week, y = dif, color="#228B22")) +
geom_smooth(data=subset(dif_prop, pre.x==1), span=2)+
geom_smooth(data=subset(dif_prop, pre.x==0), span=2)+
geom_point(shape=15) +
theme(axis.text.x=element_text(size=10))+
geom_vline(xintercept = ymd("2019-04-09"), linetype=2, color="grey", size=.6) +
annotate("text", x = ymd("2019-04-09"), y = .15, label = "Election I", family = "Times", size = 3)+
geom_vline(xintercept = ymd("2019-09-17"), linetype=2, color="grey", size=.6) +
annotate("text", x = ymd("2019-09-17"), y = .15, label = "Election II", family = "Times", size = 3)+
geom_vline(xintercept = ymd("2020-01-26"), linetype=1, color="black", size=.6) +
annotate("text", x = ymd("2020-01-26"), y = .17, label = "Deal of the Century", family = "Times", size = 3)+
geom_vline(xintercept = ymd("2020-03-02"), linetype=2, color="grey", size=.6) +
annotate("text", x = ymd("2020-04-02"), y = .15, label = "Election III",family = "Times", size = 3)+
scale_color_manual(values = c("#228B22")) +
labs(color = "",
x = "Date",
y = "Weekly Difference in Prop. of Posts")+
theme(text = element_text(size = 12, family = "Times"),
legend.key=element_blank(),
panel.grid.major = element_blank(),
axis.text.x = element_text(size = 12),
plot.caption = element_text(size = 12, family = "Times",hjust = -.02),
panel.grid.minor = element_blank(),
panel.background = element_blank(),
axis.line = element_line(colour = "black"))+
scale_color_manual(name = "", labels = c("Triangle vs. \n Non-Triangle"), values = c("#228B22"))
setwd("..")
ls()
panel
str(panel)
raw_st <- read_csv("../data/ST/ST_DATABASE.csv")
problems()
st_city_codes <- read_csv("../data/ST/ST_cities_code.csv")
dates <- read_csv("../data/dates.csv")
localities <- read_excel("../data/yishuv_21.xlsx")
yishuv_index <- read_excel("../data/bycode2018.xlsx")
rm(list = ls())
getwd()
list.files()
list.files("data")
ls()
.ls.objects()
.ls.objects()
st_final <- final_data
.ls.objects()
.ls.objects()
dim(final_data)
names(st_final)
getwd()
saveRDS(st_final, "data/st_final.RDS")
rm(list = ls())
getwd()
ls()
names(st_final)
.ls.objects()
names(st_final)
str(st_final)
table(st_final$arab, useNA = "ifany")
table(st_final$locality_relig, useNA = "ifany")
table(st_final$non_jewish, useNA = "ifany")
table(samoha$edu)
table(samoha$area)
q()
n
install.packages("zeligverse")
getwd()
setwd("..")
dim(st_final)
names(st_final)
names(st_final)
range(st_final$daily_join, na.rm = TRUE)
head(st_final$date)
q()
n
